#include "triangle.h"



    triangle::triangle() {pcount=0;}


    void triangle::setpoints(vertex ppoints[3])
    {

        for(int i=0; i<3; i++)
        {
            points[i]=ppoints[i];
        }


    }

    void triangle::add_point(vertex &point){
        if(pcount<3)
        points[pcount]=point;
        pcount++;
    }

    void triangle::set_point(int num, vertex &point){

        points[num]=point;

    }


    double triangle::a_depth(){

        double r=0;
        for(int i=0; i<pcount; i++){
            r+=points[i].pos.z;
        }

        r/=pcount;
        return r;

   }

